package week3.day18;

import java.util.Random;

/**
 * @Author fengzihao
 * @Date 2024-05-02 19:46
 */
public class ExhaustivelyMatchThePassword {
    public static void main(String[] args) {
        Random random = new Random();
        int password = random.nextInt(1000);
        String str = String.format("%03d",password);
        System.out.println("the init right password = " + str);
        for (int i = 0; i < 1000; i++) {
            String inPassword = String.format("%03d",i);
            if (str.equals(inPassword)){
                System.out.println("the right password = " + inPassword);
                break;
            }
            System.out.println("i = " + String.format("%03d",i));

        }
    }
}
